<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>

</head>

<body>
  <div id="app">
    <input type="text" v-model.number="num1">
    <select name="" id="" v-model="type">
      <option value="*">*</option>
      <option value="-">-</option>
      <option value="/">/</option>
      <option value="+">+</option>
    </select>
    <input type="text" v-model.number="num2">

    <h3>{{ result }}</h3>
  </div>
  <script>
    let vm = new Vue({
      el: '#app',
      data: {
        num1: 0,
        num2: 0,
        type: '*'
      },
      computed: {
        // result() {
        //   return this.num1 * this.num2
        // }
        result: {
          get() {
            let s = '';
            switch (this.type) {
              case "*":
                s = this.num1 * this.num2
                break
              case "-":
                s = this.num1 - this.num2

                break
              case "/":
                s = this.num1 / this.num2

                break
              case "+":
                s = this.num1 + this.num2

                break
            }
            return s
          },
          set() {

          }
        }
      }
    })
  </script>
</body>

</html>